<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Cadastro de Aluno</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link rel="stylesheet" type="text/css"
	href="bootstrap/css/bootstrap.css" />
	
<script>  
function validarSenha(){
	
	var senha = document.getElementById("password");
	var senha1 = document.getElementById("password1");
	
	if (senha.value != senha1.value)
	{
		document.getElementById("senhaerrada").style.display = "block";
		return false;
	}
	else
	{
		document.getElementById("senhaerrada").style.display = "none";
		return true;
	}
		
}

</script>
	
	
</head>
<body>
	<div class="container">
		<div class="row">
			<div class="col-md-4">
				<form:form method="POST" action="addstudentsave" id="formaddStudent"
					modelAttribute="student" class="form-horizontal loginbox" name="f1">

					<!-- Form Name -->
					<legend>Cadastro Aluno</legend>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="name" class="control-label" for="Name">Nome</form:label>
						<div class="controls">
							<form:input path="name" id="Name" name="Name" type="text" placeholder="Nome"
								class="input-xlarge" required="" />
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="email" class="control-label" for="email">Email</form:label>
						<div class="controls">
							<form:input path="email" id="email" name="email" type="email" placeholder="Email"
								class="input-xlarge" />
						</div>
					</div>

					<!-- Password input-->
					<div class="control-group">
						<form:label path="password" class="control-label" for="password">Senha</form:label>
						<div class="controls">
							<form:input path="password" id="password" name="password" type="password"
								placeholder="Senha" class="input-xlarge" />
						</div>
					</div>
					
					<div class="control-group">
						<form:label path="password" class="control-label" for="password1">Confirmar senha</form:label>
						<div class="controls">
							<form:input path="password" id="password1" name="password1" type="password"
								placeholder="Senha" class="input-xlarge" onblur="validarSenha()"/>
								<p id="senhaerrada" style="display:none" class="alert alert-error">Senhas não se conferem!</p>
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="registration" class="control-label" for="registration">Matricula</form:label>
						<div class="controls">
							<form:input path="registration" id="registration" name="registration" type="text"
								placeholder="Número de Matrícula" class="input-large" required="" />
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="cpf" class="control-label" for="cpf">CPF</form:label>
						<div class="controls">
							<form:input path="cpf" id="cpf" name="cpf" type="text"
								placeholder="Número do CPF" class="input-large" required="" />
						</div>
					</div>
					
					<!-- Text input-->
					<div class="control-group">
						<form:label path="departament" class="control-label" for="departament">Departamento</form:label>
						<div class="controls">
							<form:input path="departament" id="departament" name="departament" type="text"
								placeholder="Departamento" class="input-xlarge" required="" />
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="country" class="control-label" for="country">País</form:label>
						<div class="controls">
							<form:input path="country" id="country" name="country" type="text" placeholder="País"
								class="input-large" required="" />
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="cep" class="control-label" for="zipcode">CEP</form:label>
						<div class="controls">
							<form:input path="cep" id="zipcode" name="zipcode" type="text" placeholder="CEP"
								class="input-medium" required="" />

						</div>
					</div>

					<!-- Select Basic -->
					<div class="control-group">
						<form:label path="state" class="control-label" for="state">Estado</form:label>
						<div class="controls">
							<form:select path="state" id="state" name="state">
								<form:option value="Acre" label="AC" selected="true"/>
					            <form:option value="Alagoas" label="AL"/>
								<form:option value="Amapá" label="AP"/>
								<form:option value="Amazonas" label="AM"/>
								<form:option value="Bahia" label="BA"/>
								<form:option value="Ceará" label="CE"/>
								<form:option value="Distrito Federal" label="DF"/>
								<form:option value="Espírito Santo" label="ES"/>
								<form:option value="Goiás" label="GO"/>
								<form:option value="Maranhão" label="MA"/>
								<form:option value="Mato Grosso" label="MT"/>
								<form:option value="Mato Grosso do Sul" label="MS"/>
								<form:option value="Minas Gerais" label="MG"/>
								<form:option value="Pará" label="PA"/>
								<form:option value="Paraíba" label="PB"/>
								<form:option value="Paraná" label="PR"/>
								<form:option value="Pernambuco" label="PE"/>
								<form:option value="Piauí" label="PI"/>
								<form:option value="Rio de Janeiro" label="RJ"/>
								<form:option value="Rio Grande do Norte" label="RN"/>
								<form:option value="Rio Grande do Sul" label="RS"/>
								<form:option value="Rondônia" label="RO"/>
								<form:option value="Roraima" label="RR"/>
								<form:option value="Santa Catarina" label="SC"/>
								<form:option value="São Paulo" label="SP"/>
								<form:option value="Sergipe" label="SE"/>
								<form:option value="Tocantins" label="TO"/>
							</form:select>
						</div>
					</div>

					<!-- Select Basic -->
					<div class="control-group">
						<form:label path="city" class="control-label" for="city">Cidade</form:label>
						<div class="controls">
							<form:input path="city" id="city" name="city" type="text"
								placeholder="Cidade" class="input-xlarge" required="" />				
							<!--<select id="city" name="city" class="input-xlarge">
							</select> -->
						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="neighborhood" class="control-label" for="neighborhood">Bairro</form:label>
						<div class="controls">
							<form:input path="neighborhood" id="neighborhood" name="neighborhood" type="text"
								placeholder="Bairro" class="input-xlarge" required="" />

						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="street" class="control-label" for="street">Rua</form:label>
						<div class="controls">
							<form:input path="street" id="street" name="street" type="text" placeholder="Rua"
								class="input-xlarge" required="" />

						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="complement" class="control-label" for="complement">Complemento</form:label>
						<div class="controls">
							<form:input path="complement" id="complement" name="complement" type="text"
								placeholder="Complemento" class="input-xlarge" required="" /> 

						</div>
					</div>

					<!-- Text input-->
					<div class="control-group">
						<form:label path="home_number" class="control-label" for="home_number">Número</form:label>
						<div class="controls">
							<form:input path="home_number" id="home_number" name="home_number" type="text"
								placeholder="Número" class="input-small" required="" />

						</div>
					</div>

					<!-- Button -->
					<div class="control-group">
						<div class="controls">
							<form:button type="submit" class="btn btn-success">Salvar</form:button>
						</div>
					</div>

					</fieldset>
				</form:form>

			</div>
		</div>
	</div>

</body>
</html>